import { resolve } from 'path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite'
import AutoImport from 'unplugin-auto-import/vite'
import WindiCSS from 'vite-plugin-windicss'

// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    alias: {
      '~': resolve(__dirname, 'src'),
    },
  },
  plugins: [
    vue(),
    Components({
      dts: true,
      dirs: [
        'src/components',
        'src/views/*/components',
      ],
    }),
    AutoImport({
      dts: true,
      imports: [
        'vue',
        'vue/macros',
        'vue-router',
      ],
    }),
    WindiCSS(),
  ],
})
